package com.xnyzc.lhy.common.penum.order;

public enum EInvoiceType {
    noHave(0, "未开具"),
    haveInvocie(1, "已开具"),
    makeInvoice(2, "开票中"),
    cancellation(3, "已作废"),
    invalid(4, "作废中");

    private Integer type;
    private String value;

    EInvoiceType(Integer type, String value) {
        this.type = type;
        this.value = value;
    }

    public static EInvoiceType findById(Integer type) {
        EInvoiceType ePaymentType;
        switch (type) {
            case 0:
                ePaymentType = EInvoiceType.noHave;
                break;
            case 1:
                ePaymentType = EInvoiceType.haveInvocie;
                break;
            case 2:
                ePaymentType = EInvoiceType.makeInvoice;
                break;
            case 3:
                ePaymentType = EInvoiceType.cancellation;
                break;
            case 4:
                ePaymentType = EInvoiceType.invalid;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return ePaymentType;
    }

    public String getValue() {
        return this.value;
    }

    public Integer getType() {
        return this.type;
    }
}
